package junit;

import junit.framework.TestCase;

import org.junit.Test;

import ead.Stack;

public class StackTest extends TestCase{

	private Stack<Integer> pilha;
	
	@Override
	protected void setUp() throws Exception{
		pilha = new Stack<Integer>();
		pilha.push(new Integer(5));
		pilha.push(new Integer(6));
		pilha.push(new Integer(7));
		pilha.push(new Integer(8));
	}
	
	@Test
	public void testPush() {
		pilha.push(new Integer(9));
		assertEquals("Result", new Integer(9), (Integer)pilha.top());		
	}

	@Test
	public void testTop() {
		assertEquals("Result", new Integer(8), (Integer)pilha.top());
	}

	@Test
	public void testPop() {
		pilha.pop();
		assertEquals("Result", new Integer(7), (Integer)pilha.top());
	}

	@Test
	public void testIsEmpty() {
		pilha.empty();
		assertEquals("Result", true, pilha.isEmpty());
	}

	@Test
	public void testSize() {
		assertEquals("Result", 4, pilha.size());
	}

}
